import java.util.*;
public class SubstrCompDemo {
	public static void main(String[] unused){
		String[] strings = {
				"painful",
				"mainly",
				"gaining",
				"raindrops"
		};
		Arrays.sort(strings);
		dump(strings, "Utilizand sortarea de baza");
	}
	static void dump(String[] args, String title){
		System.out.println(title);
		for(int i=0; i<args.length;i++)
			System.out.println(args[i]);
	}

}
